#define INH_A  2
#define IN_A   3
#define INH_B  4
#define IN_B   5
#define INH_C  6
#define IN_C   7

const int INH[] = {INH_A, INH_B, INH_C};
const int IN[]  = {IN_A, IN_B, IN_C};

void setup()
{
  for (int i=0; i<3; i++){
    pinMode(INH[i], OUTPUT);
    digitalWrite(INH[i], LOW);
  }
  for (int i=0; i<3; i++){
    pinMode(IN[i], OUTPUT);
    digitalWrite(INH[i], LOW);
  }
}


void dw(int pin, int level){
  digitalWrite(pin, level);
}


void all_off(){
  for (int i=0; i<3; i++){
    digitalWrite(INH[i], LOW);
  }
}


void all_do(int level){
  for (int i=0; i<3; i++){
    digitalWrite(INH[i], level);
    digitalWrite(IN[i], level);
  }
}


void motor_blink(int t){
  all_do(HIGH);
  delay(t);
  all_do(LOW);
  delay(t);
}


void loop()
{
  const int delay_t = 3000;

  // A B
  all_off();
  dw(INH_A, HIGH);
  dw(INH_B, HIGH);
  dw(IN_A, HIGH);
  dw(IN_B, LOW);
  delay(delay_t);

  dw(INH_A, HIGH);
  dw(INH_B, HIGH);
  dw(IN_A, LOW);
  dw(IN_B, HIGH);
  delay(delay_t);

  // B C
  all_off();
  dw(INH_B, HIGH);
  dw(INH_C, HIGH);
  dw(IN_B, HIGH);
  dw(IN_C, LOW);
  delay(delay_t);

  all_off();
  dw(INH_B, HIGH);
  dw(INH_C, HIGH);
  dw(IN_B, LOW);
  dw(IN_C, HIGH);
  delay(delay_t);

}
